package com.k7.mobile.platform.web.interceptor;

import org.apache.log4j.Logger;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

public class ExceptionInterceptor extends AbstractInterceptor{
	private static final long serialVersionUID = 535382781313234390L;
	protected Logger log = Logger.getLogger(this.getClass()); 

	@Override
	public String intercept(ActionInvocation invocation) throws Exception {
		try{
			return invocation.invoke();
		}catch(Exception ex){
			log.error(ex.getMessage(), ex);
			return Action.ERROR;
		}
	}
}
